import {Vec3} from 'cc';

/**
 * Vec3转换器
 * public convertFromVector: (V) -> T
 * public convertToVector: (T) -> V
 */
export class Vec3Converter {
    /**
     * 禁止创建对象
     */
    private constructor() {
    }

    /**
     * 字符串转Vec3
     *
     * @param vec3 Vec3
     */
    public static convertFromString(vec3: string): Vec3 {
        let array = vec3.split(",").map(value => Number(value));
        return new Vec3(array[0], array[1], array[2]);
    }
}